//
//  CRNCountDownButton.h
//  CRNCountDownButton
//
//  Created by VierGhost on 15/7/24.
//  Copyright (c) 2015年 dingli. All rights reserved.
//

#import <UIKit/UIKit.h>
@class CRNCountDownButton;
typedef NSString* (^DidChangeBlock)(CRNCountDownButton *countDownButton,int second);
typedef NSString* (^DidFinishedBlock)(CRNCountDownButton *countDownButton,int second);

typedef void (^TouchedDownBlock)(CRNCountDownButton *countDownButton,NSInteger tag);

@interface CRNCountDownButton : UIButton
{
    int _second;
    int _totalSecond;
    
    NSTimer *_timer;
    NSDate *_startDate;
    
    DidChangeBlock _didChangeBlock;
    DidFinishedBlock _didFinishedBlock;
    TouchedDownBlock _touchedDownBlock;
}
//@property(nonatomic,strong)UIColor *changeFontColor;
//@property(nonatomic,strong)UIColor *normalFontColor;
+(CRNCountDownButton *)setButtonType:(UIButtonType)type;

-(void)addToucheHandler:(TouchedDownBlock)touchHandler;

-(void)didChange:(DidChangeBlock)didChangeBlock;
-(void)didFinished:(DidFinishedBlock)didFinishedBlock;
-(void)startWithSecond:(int)second;
- (void)stop;

@end
